package com.test.springboot_test.test02_LambdaAndStream.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;


import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode//用于后期的去重使用
public class Author implements Comparable<Author>{
    @Override
    public int compareTo(Author o) {
        return this.getAge()-o.getAge();
    }

    private Long id;
    private String name;
    private Integer age;
    private String intro;
    //作品
    private List<Book> books;


}
